# +----------------------------------------------------------------------
# | ChatWork智能聊天办公系统
# +----------------------------------------------------------------------
# | 软件声明: 本系统并非自由软件,未经授权任何形式的商业使用均属非法。
# | 版权保护: 任何企业和个人不允许对程序代码以任何形式任何目的复制/分发。
# | 授权要求: 如有商业使用需求,请务必先与版权所有者取得联系并获得正式授权。
# +----------------------------------------------------------------------
# | Author: ChatWork Team <2474369941@qq.com>
# +----------------------------------------------------------------------
from typing import List, Dict
from pydantic import BaseModel, Field


class UploadResultVo(BaseModel):
    """ 上传结果Vo """
    id: int = Field(description="主键")
    name: str = Field(description="文件名称")
    size: int = Field(description="文件大小")
    ext: str = Field(description="文件扩展")
    path: str = Field(description="文件路径")
    url: str = Field(description="访问路径")


class SysConfigVo(BaseModel):
    """ 后台配置项Vo """
    name: str = Field(description="网站名称")
    title: str = Field(description="网站名称")
    copyright: str = Field(description="版权信息")
    cover: str = Field(description="登录封面")
    favicon: str = Field(description="站点图标")
    pc_logo: str = Field(description="PC端logo")
    logo_black_big: str = Field(description="深色大logo")
    logo_black_small: str = Field(description="深色小logo")
    logo_white_big: str = Field(description="浅色大logo")
    logo_white_small: str = Field(description="浅色小logo")
    enable_captcha: bool = Field(description="启用验证码")
    env_deter: bool = Field(description="限制模式")
    oss_domain: str = Field(description="存储域名")


class WorkbenchVo(BaseModel):
    """ 控制台数据Vo """
    version: dict = Field(description="版本信息")
    today: List[dict] = Field(description="今日数据")
    shortcut: List[dict] = Field(description="快捷方式")
    backlogs: List[dict] = Field(description="待办事项")
    echartsVisitor: Dict[str, list] = Field(description="访客的趋势图")
    echartsWebsite: List[dict] = Field(description="浏览器趋势图")


class AiModelsVo(BaseModel):
    """ 主页数据Vo """
    class Llm(BaseModel):
        model: str = Field(description="模型")
        alias: str = Field(description="别名")
        price: int = Field(description="售价")
        modal: bool = Field(description="多模态")
        think: bool = Field(description="深度思考")
        func: bool = Field(description="FunctionCall")
        max_tokens: int = Field(description="最大输出Tokens")

    mark: str = Field(description="通道标识")
    name: str = Field(description="通道名称")
    logo: str = Field(description="通道图标")
    config: List[dict] = Field(description="模型配置")
    models: List[Llm] = Field(description="模型列表")

    class Config:
        json_schema_extra = {
            "example": {
                "id": 1,
                "name": "OpenAI",
                "logo": "https://www.xx.cn/models/gpt3.5.png",
                "models": [
                    {
                        "model": "gpt-3.5-turbo",
                        "alias": "gpt35",
                        "price": "0.002",
                        "modal": True,
                        "think": True,
                        "func": True,
                        "max_tokens": 8610
                    }
                ]
            }
        }
